<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head th:include="ui/common/taglibs::head">
</head>
<body>
<div class="easyui-layout" data-options="fit:true">
<div class="floating_layer">
    <b class='fold_button fold_button_center' onclick='exPand(this)'>展开搜索</b>
</div>
<div data-options="region:'north'" class="ycSearch searchArea" >
	<!-- 查询条件表单 -->
	<form id="search_form" >
		<div class="searchP searchPad">
			<em>登录名称：</em>
			<input type="text" name="loginName" class="easyui-textbox" data-options=""/>
		</div>
		<div class="searchP searchPad">
			<em>用户姓名：</em>
			<input type="text" name="userName" class="easyui-textbox" data-options=""/>
		</div>
		<div class="searchP searchPad">
			<em>下拉树：</em>
			<select id="yyy" class="easyui-combotree"  editable="true"></select>
		</div>

		<div class="searchP searchPad">
			<em>下拉单选：</em>
			<select id="cc"></select>
			<div id="sp" class="radioSelect">
				<div><input type="radio" name="lang" value="01"><span>Java</span></div>
				<div><input type="radio" name="lang" value="02"><span>C#</span></div>
				<div><input type="radio" name="lang" value="03"><span>的地方的</span></div>
				<div><input type="radio" name="lang" value="04"><span>Basic</span></div>
				<div><input type="radio" name="lang" value="05"><span>Fortran</span></div>
			</div>
		</div>
		
		<div class="searchP searchPad">
			<em>下拉全选：</em>
			<input id="zzz" name="dept" editable="true" />
		</div>
		<div class="searchP searchPad">
            <em>活动时间</em>
            <input id="actStartTime" name="actStartTime"  type="text" class="layui-datatime" />
            <em>至</em>
            <input id="xfTimeMax"  name="xfTimeMax"  type="text" class="layui-datatime" />
        </div>
		<div class="searchP searchPad">
			<em>状态：</em>
			<select class="easyui-combobox" editable="false">
			    <option value="all">全部</option>
			    <option value="0">启用</option>
			    <option value="1">禁用</option>
			</select>
		</div>
		<div class="searchP spButton">
			<p><a href="javascript:void(0)" class="sQuery" onclick="javascript:ConfigSp.pageDealing()"></a></p>	
	 	</div>
	</form>
</div>
		
<div data-options="region:'center'" >
	<div class="easyui-layout ycBottom" data-options="fit:true">
		<!-- 组织结构树 -->
		<div data-options="region:'west'" title="组织结构" class="ycTree">
			<ul id="easyuiTree" class="easyui-tree"></ul>
		</div>
		
		<div id="gridview-toolbar" class="tableTopButton clearfix">
            <p><a class="modify" onclick="" >修改</a></p>
            <p><a class="delect" onclick="" >删除</a></p>
            <p><a class="listAttempt" onclick="" >列表视图</a></p>
		    <p><a class="statisticalAttempt" onclick="" >统计视图</a></p>
            <p><a class="return" onclick="" >返回</a></p>
            <p><a class="save" onclick="" >保存</a></p>
            <p><a class="refresh" onclick="" >重置</a></p>
            <p><a class="look" onclick="" >查看</a></p>
            <p><a class="release" onclick="" >发布/申请</a></p>
            <p><a class="add" onclick="" ><i></i>新增</a></p>
            <p><a class="consult" onclick="" >阅文/查阅</a></p>
            <p><a class="feedback" onclick="" >反馈</a></p>
            <p><a class="edit" onclick="" >写信/编辑</a></p>
            <p><a class="person" onclick="" >用户</a></p>
            <p><a class="empty" onclick="" >清空</a></p>
            <p><a class="sign" onclick="" >标记</a></p>
            <p><a class="reply" onclick="" >回复</a></p>
            <p><a class="forward" onclick="" >转发</a></p>
            <p><a class="replyWithOriginal" onclick="" >回复带原文</a></p>
            <p><a class="export" onclick="" >导出</a></p>
            <p><a class="import" onclick="" >导入</a></p>
            <p><a class="sendSMS" onclick="" >发短信</a></p>
            <p><a class="sendMessage" onclick="" >发消息</a></p>
            <p><a class="moveUp" onclick="" >上移</a></p>
            <p><a class="moveDown" onclick="" >下移</a></p>
            <p><a class="shear" onclick="" >剪切</a></p>
            <p><a class="copy" onclick="" >复制</a></p>
            <p><a class="paste" onclick="" >黏贴</a></p>
            <p><a class="delivery" onclick="" >传送/移动</a></p>
            <p><a class="audit" onclick="" >审核</a></p>
            <p><a class="cancel" onclick="" >取消</a></p>
            <p><a class="eml" onclick="" >邮件</a></p>
            <p><a class="whollyDelect" onclick="" >彻底删除</a></p>
            <p><a class="share" onclick="" >共享</a></p>
            <p><a class="resend" onclick="" >重新发送</a></p>
            <p><a class="upload" onclick="" >上传</a></p>
            <p><a class="download" onclick="" >下载</a></p>
            <p><a class="attribute" onclick="" >属性</a></p>
        </div>
        
		<!-- 页面操作按钮 -->
		<div data-options="region:'center'" class="yTable autoWidth">
			<table id="list"></table>
		</div>
	</div>
</div>

</div>
<script type="text/javascript">
$(function(){
	$('#list').datagrid({
		fit: true,
		idField:'id',
		//rownumbers:true,
		striped: true,
		autoRowHeight:false,
		url:'[[${ctx}]]/getJson?json=datagridJson',
		frozenColumns:[ [
  		                { field:'ck',
  		                  checkbox:true
  		                  }
  					]],
		columns:[ [ 
		    {
		    	field:'id',
		    	title:'主键',
		    	hidden:true
		    	},   
		    {
		    		field:'productid',
		    		title:'登录名称', 
		    		align:'center',
		    		width:150,
		    		formatter:
		    			function(value, rec, index){
	           	  return "<a href='javascript:void()' onclick='' class='tabsTit' title='"+ value +"'>"+value+"</a>";
        	} },
            { field:'unitcost',
        		title:'用户姓名',
        		align:'left',width:100,formatter:function(value, rec, index){
           	  return "<span title='"+ value +"'>"+value+"</span>";
        	} },
            { field:'status',title:'状态', align:'center',width:100,formatter:function(value, rec, index){
        		if (value == '0') {
               		return "<span class='tabsMail'></span>";
               	} else {
               		return "<span class='tabsMailOpen'></span>";
               	}
          	}},
            { field:'listprice',
          		title:'附件', 
          		align:'center',width:100,formatter:function(value, rec, index){
          		if (value == '0') {
               		return "<span class='tabsAttachment'></span>";
               	} else {
               		return " ";
               	}
          	}},
            {field:'attr1',title:'33333', align:'left',width:100,formatter:function(value, rec, index){
             	  return "<span title='"+ value +"'>"+value+"</span>";
          	}},
            {field:'itemid',title:'666', align:'left',width:100,formatter:function(value, rec, index){
             	  return "<span title='"+ value +"'>"+value+"</span>";
          	}}
		]],
		toolbar:'#gridview-toolbar', 
		pagination:true,
		pageSize: 10,//每页显示的记录条数，默认为
		pageList: [10,20,30,40,50],//可以设置每页记录条数的列表   pageList: [10,20,30,40,50]
	    queryParams:{},
		onLoadSuccess:function(data){
		    $('#list').datagrid('clearSelections');	//清除掉列表选中记录
		     //debugger;
			$('.datagrid-row div').each(function(){
				var aa = $(this).css('text-align');
				if(aa == 'left'){
					$(this).css('margin-left',0);
				}
				if(aa == 'right'){
					$(this).css('margin-right',0);
				}
			})
			if(data.total==0){					
				$('.datagrid-body-inner').eq(0).addClass("l_elist");					
				$('.datagrid-body').eq(1).append('<div class="r_elist">暂无数据显示</div>');					
			}else{
			    $('.datagrid-body-inner').eq(0).removeClass("l_elist");
			}
		}

	});
	//日期时间控件
	laydate.render({
		  elem: '#actStartTime'
		  ,theme: '#1b59ad'
		});
	laydate.render({
		  elem: '#xfTimeMax'
		  ,theme: '#1b59ad'
		});
	//下拉树
	$('#yyy').combotree({
	    url:'[[${ctx}]]/getJson?json=xlTreeJson',
	    animate:true,
	    lines:true,
	    //onlyLeafCheck:true,    //设置父级无复选框
	    //checkbox:true,
	    multiple: true,
	    cascadeCheck:true
	});
	//combo
	$('#cc').combo({
		required:false,
		editable:false
	});
	$('#sp').appendTo($('#cc').combo('panel'));
	$('#sp input').click(function(){
		var v = $(this).val();
		var s = $(this).next('span').text();
		$('#cc').combo('setValue', v).combo('setText', s).combo('hidePanel');
	});
	//下拉全选
	$('#zzz').combogrid({
	    panelWidth:130,
	    panelHeight:150,
	    multiple: true,
	    idField: 'itemid',
	    textField:'productid',
	    url:'[[${ctx}]]/getJson?json=xlgridJson',
	    columns:[ [
	    {field:'ck',checkbox:true},
	    {field:'productid',title:'全部',width:100,align:'left'}
	    ]]
	});
	
	$('#easyuiTree').tree({
	    url:'[[${ctx}]]/getJson?json=easyTreeJson',
	    animate:true,
	    lines:true,
	    checkbox:true,
	    onClick: function(node){
              var state = node.checked;
	    	  if(state==true){
	    	  	$("#easyuiTree").tree('uncheck',node.target);
	    	  }else if(state==false){
	    	  	$("#easyuiTree").tree('check',node.target);
	    	  }
	    }
	});
	
	ConfigSp.pageDealing = function(yqId,module){
        top.layer.open({
            type: 1,//iframe层
            title: '页面框',
            maxmin: true,
            //closeBtn: 0,
            shadeClose: false, //点击遮罩关闭层
            area : ['800px' , '620px'],
            content:"内容",
            btn: ['确定','取消']
            ,yes: function(index, layero){
                //按钮【按钮一】的回调
                var iframe = this.iframe.contentWindow;
                iframe.ConfigSp.dealYqsq(self);
                parent.location.reload();//刷新父页面
            }
            ,btn2: function(index, layero){
                //按钮【按钮二】的回调
                layer.close(index);
                //return false 开启该代码可禁止点击该按钮关闭
            }
            ,cancel: function(){
                //右上角关闭回调
                //return false 开启该代码可禁止点击该按钮关闭
            }
        });
    };
	
	acontraction();
	
});

</script>
</body>
</html>
